/**
 * Copyright (C) 2010-2014 KO GmbH <copyright@kogmbh.com>
 *
 * @licstart
 * This file is part of WebODF.
 *
 * WebODF is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License (GNU AGPL)
 * as published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * WebODF is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with WebODF.  If not, see <http://www.gnu.org/licenses/>.
 * @licend
 *
 * @source: http://www.webodf.org/
 * @source: https://github.com/kogmbh/WebODF/
 */

@namespace draw url(urn:oasis:names:tc:opendocument:xmlns:drawing:1.0);
@namespace fo url(urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0);
@namespace office url(urn:oasis:names:tc:opendocument:xmlns:office:1.0);
@namespace presentation url(urn:oasis:names:tc:opendocument:xmlns:presentation:1.0);
@namespace style url(urn:oasis:names:tc:opendocument:xmlns:style:1.0);
@namespace svg url(urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0);
@namespace table url(urn:oasis:names:tc:opendocument:xmlns:table:1.0);
@namespace text url(urn:oasis:names:tc:opendocument:xmlns:text:1.0);
@namespace webodfhelper url(urn:webodf:names:helper);
@namespace cursor url(urn:webodf:names:cursor);
@namespace editinfo url(urn:webodf:names:editinfo);
@namespace annotation url(urn:webodf:names:annotation);
@namespace dc url(http://purl.org/dc/elements/1.1/);
@namespace svgns url(http://www.w3.org/2000/svg);

office|document > *, office|document-content > * {
  display: none;
}
office|body, office|document {
  display: inline-block;
  position: relative;
}

text|p, text|h {
  display: block;
  padding: 0;
  margin: 0;
  line-height: normal;
  position: relative;
}

text|p::after, text|h::after {
    /* prevent empty paragraphs and headings from collapsing */
    content: "\200B"; /* ZERO WIDTH SPACE */
    white-space: pre;
}

*[webodfhelper|containsparagraphanchor] {
  position: relative;
}
text|s {
    white-space: pre;
}
text|tab {
  display: inline;
  white-space: pre;
}
text|tracked-changes {
  /*Consumers that do not support change tracking, should ignore changes.*/
  display: none;
}
office|binary-data {
  display: none;
}
office|text {
  display: block;
  text-align: left;
  overflow: visible;
  word-wrap: break-word;
}

office|text::selection {
  /** Let's not draw selection highlight that overflows into the office|text
   * node when selecting content across several paragraphs
   */
  background: transparent;
}

.webodf-virtualSelections *::selection {
  background: transparent;
}
.webodf-virtualSelections *::-moz-selection {
  background: transparent;
}

office|text * draw|text-box {
/** only for text documents */
    display: block;
    border: 1px solid #d3d3d3;
}
office|text draw|frame {
  /** make sure frames are above the main text. */
  z-index: 1;
}
office|spreadsheet {
  display: block;
  border-collapse: collapse;
  empty-cells: show;
  font-family: sans-serif;
  font-size: 10pt;
  text-align: left;
  page-break-inside: avoid;
  overflow: hidden;
}
office|presentation {
  display: inline-block;
  text-align: left;
}
#shadowContent {
  display: inline-block;
  text-align: left;
}
draw|page {
  display: block;
  position: relative;
  overflow: hidden;
}
presentation|notes, presentation|footer-decl, presentation|date-time-decl {
    display: none;
}
@media print {
  draw|page {
    border: 1pt solid black;
    page-break-inside: avoid;
  }
  presentation|notes {
    /*TODO*/
  }
}
office|spreadsheet text|p {
  border: 0px;
  padding: 1px;
  margin: 0px;
}
office|spreadsheet table|table {
  margin: 3px;
}
office|spreadsheet table|table:after {
  /* show sheet name the end of the sheet */
  /*content: attr(table|name);*/ /* gives parsing error in opera */
}
office|spreadsheet table|table-row {
  counter-increment: row;
}
office|spreadsheet table|table-row:before {
  width: 3em;
  background: #cccccc;
  border: 1px solid black;
  text-align: center;
  content: counter(row);
  display: table-cell;
}
office|spreadsheet table|table-cell {
  border: 1px solid #cccccc;
}
table|table {
  display: table;
}
draw|frame table|table {
  width: 100%;
  height: 100%;
  background: white;
}
table|table-header-rows {
  display: table-header-group;
}
table|table-row {
  display: table-row;
}
table|table-column {
  display: table-column;
}
table|table-cell {
  width: 0.889in;
  display: table-cell;
  word-break: break-all; /* prevent long words from extending out the table cell */
}
draw|frame {
  display: block;
}
draw|image {
  display: block;
  width: 100%;
  height: 100%;
  top: 0px;
  left: 0px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  -moz-background-size: 100% 100%;
}
/* only show the first image in frame */
draw|frame > draw|image:nth-of-type(n+2) {
  display: none;
}
text|list:before {
    display: none;
    content:"";
}
text|list {
    display: block;
}
text|list-item {
    display: block;
}
text|number {
    display:none;
}

text|a {
    color: blue;
    text-decoration: underline;
    cursor: pointer;
}
.webodf-inactiveLinks text|a {
    cursor: text;
}
text|note-citation {
    vertical-align: super;
    font-size: smaller;
}
text|note-body {
    display: none;
}
text|note:hover text|note-citation {
    background: #dddddd;
}
text|note:hover text|note-body {
    display: block;
    left:1em;
    max-width: 80%;
    position: absolute;
    background: #ffffaa;
}
text|bibliography-source {
  display: none;
}
svg|title, svg|desc {
    display: none;
}
video {
    width: 100%;
    height: 100%
}

/* below set up the cursor */
cursor|anchor {
    display: none;
}

cursor|cursor {
    display: none;
}

.webodf-caretOverlay {
    position: absolute;
    top: 5%; /* push down the caret; 0px can do the job, 5% looks better, 10% is a bit over */
    height: 1em;
    z-index: 10;
    padding-left: 1px; /* centre 2px caret into middle of overlay */
    pointer-events: none;
}

.webodf-caretOverlay .caret {
    position: absolute;
    border-left: 2px solid black;
    top: 0;
    bottom: 0;
    right: 0;
}

.webodf-caretOverlay .handle {
    position: absolute;
    margin-top: 5px;
    padding-top: 3px;
    margin-left: auto;
    margin-right: auto;
    width: 64px;
    height: 68px;
    border-radius: 5px;
    opacity: 0.3;
    text-align: center;
    background-color: black;
    box-shadow: 0px 0px 5px rgb(90, 90, 90);
    border: 1px solid black;

    top: -85px;
    right: -32px;
}

.webodf-caretOverlay .handle > img {
    box-shadow: 0px 0px 5px rgb(90, 90, 90) inset;
    background-color: rgb(200, 200, 200);
    border-radius: 5px;
    border: 2px solid;
    height: 60px;
    width: 60px;
    display: block;
    margin: auto;
}

.webodf-caretOverlay .handle.active {
    opacity: 0.8;
}

.webodf-caretOverlay .handle:after {
    content: " ";
    position: absolute;
    width: 0px;
    height: 0px;
    border-style: solid;
    border-width: 8.7px 5px 0 5px;
    border-color: black transparent transparent transparent;

    top: 100%;
    left: 43%;
}

.webodf-caretSizer {
    display: inline-block; /* inline-block is necessary so the width can be set to 0 */
    width: 0; /* the caret sizer shouldn't take up any horizontal space */
    visibility: hidden; /* "hidden" means the client rects are still calculated, but the node content is not shown */
}

/** Input Method Editor input pane & behaviours */
/* not within a cursor */
#eventTrap {
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    outline: none;
    opacity: 0;
    color: rgba(255, 255, 255, 0); /* hide the blinking caret by setting the colour to fully transparent */
    pointer-events: none;
    /* prevent any text wrapping from occurring within the text area */
    white-space: pre;
    overflow: hidden;
}

/* within a cursor */
cursor|cursor > #composer {
    text-decoration: underline;
}

cursor|cursor[cursor|caret-sizer-active="true"],
cursor|cursor[cursor|composing="true"] {
    display: inline;
}

editinfo|editinfo {
    /* Empty or invisible display:inline elements respond very badly to mouse selection.
       Inline blocks are much more reliably selectable in Chrome & friends */
    display: inline-block;
}

.editInfoMarker {
    position: absolute;
    width: 10px;
    height: 100%;
    left: -20px;
    opacity: 0.8;
    top: 0;
    border-radius: 5px;
    background-color: transparent;
    box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);
}
.editInfoMarker:hover {
    box-shadow: 0px 0px 8px rgba(0, 0, 0, 1);
}

.editInfoHandle {
    position: absolute;
    background-color: black;
    padding: 5px;
    border-radius: 5px;
    opacity: 0.8;
    box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);
    bottom: 100%;
    margin-bottom: 10px;
    z-index: 3;
    left: -25px;
}
.editInfoHandle:after {
    content: " ";
    position: absolute;
    width: 0px;
    height: 0px;
    border-style: solid;
    border-width: 8.7px 5px 0 5px;
    border-color: black transparent transparent transparent;

    top: 100%;
    left: 5px;
}
.editInfo {
    font-family: sans-serif;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    color: white;
    width: 100%;
    height: 12pt;
}
.editInfoColor {
    float: left;
    width: 10pt;
    height: 10pt;
    border: 1px solid white;
}
.editInfoAuthor {
    float: left;
    margin-left: 5pt;
    font-size: 10pt;
    text-align: left;
    height: 12pt;
    line-height: 12pt;
}
.editInfoTime {
    float: right;
    margin-left: 30pt;
    font-size: 8pt;
    font-style: italic;
    color: yellow;
    height: 12pt;
    line-height: 12pt;
}

.annotationWrapper {
    display: inline;
    position: relative;
}

.annotationRemoveButton:before {
    content: "×";
    color: white;
    padding: 5px;
    line-height: 1em;
}

.annotationRemoveButton {
    width: 20px;
    height: 20px;
    border-radius: 10px;
    background-color: black;
    box-shadow: 0px 0px 5px rgba(50, 50, 50, 0.75);
    position: absolute;
    top: -10px;
    left: -10px;
    z-index: 3;
    text-align: center;
    font-family: sans-serif;
    font-style: normal;
    font-weight: normal;
    text-decoration: none;
    font-size: 15px;
}
.annotationRemoveButton:hover {
    cursor: pointer;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 1);
}

.annotationNote {
    width: 4cm;
    position: absolute;
    display: inline;
    z-index: 10;
    top: 0;
}
.annotationNote > office|annotation {
    display: block;
    text-align: left;
}

.annotationConnector {
    position: absolute;
    display: inline;
    top: 0;
    z-index: 2;
    border-top: 1px dashed brown;
}
.annotationConnector.angular {
    -moz-transform-origin: left top;
    -webkit-transform-origin: left top;
    -ms-transform-origin: left top;
    transform-origin: left top;
}
.annotationConnector.horizontal {
    left: 0;
}
.annotationConnector.horizontal:before {
    content: "";
    display: inline;
    position: absolute;
    width: 0px;
    height: 0px;
    border-style: solid;
    border-width: 8.7px 5px 0 5px;
    border-color: brown transparent transparent transparent;
    top: -1px;
    left: -5px;
}

office|annotation {
    width: 100%;
    height: 100%;
    display: none;
    background: rgb(198, 238, 184);
    background: -moz-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);
    background: -webkit-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);
    background: -o-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);
    background: -ms-linear-gradient(90deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);
    background: linear-gradient(180deg, rgb(198, 238, 184) 30%, rgb(180, 196, 159) 100%);
    box-shadow: 0 3px 4px -3px #ccc;
}

office|annotation > dc|creator {
    display: block;
    font-size: 10pt;
    font-weight: normal;
    font-style: normal;
    font-family: sans-serif;
    color: white;
    background-color: brown;
    padding: 4px;
}
office|annotation > dc|date {
    display: block;
    font-size: 10pt;
    font-weight: normal;
    font-style: normal;
    font-family: sans-serif;
    border: 4px solid transparent;
    color: black;
}
office|annotation > text|list {
    display: block;
    padding: 5px;
}

/* This is very temporary CSS. This must go once
 * we start bundling webodf-default ODF styles for annotations.
 */
office|annotation text|p {
    font-size: 10pt;
    color: black;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    font-family: sans-serif;
}

#annotationsPane {
    background-color: #EAEAEA;
    width: 4cm;
    height: 100%;
    display: none;
    position: absolute;
    outline: 1px solid #ccc;
}

.webodf-annotationHighlight {
    background-color: yellow;
    position: relative;
}

.webodf-selectionOverlay {
    position: absolute;
    pointer-events: none;
    top: 0;
    left: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
}
.webodf-selectionOverlay > polygon {
    fill-opacity: 0.3;
    stroke-opacity: 0.8;
    stroke-width: 1;
    fill-rule: evenodd;
}

.webodf-selectionOverlay > .webodf-draggable {
    fill-opacity: 0.8;
    stroke-opacity: 0;
    stroke-width: 8;
    pointer-events: all;
    display: none;

    -moz-transform-origin: center center;
    -webkit-transform-origin: center center;
    -ms-transform-origin: center center;
    transform-origin: center center;
}

#imageSelector {
    display: none;
    position: absolute;
    border-style: solid;
    border-color: black;
}

#imageSelector > div {
    width: 5px;
    height: 5px;
    display: block;
    position: absolute;
    border: 1px solid black;
    background-color: #ffffff;
}

#imageSelector > .topLeft {
    top: -4px;
    left: -4px;
}

#imageSelector > .topRight {
    top: -4px;
    right: -4px;
}

#imageSelector > .bottomRight {
    right: -4px;
    bottom: -4px;
}

#imageSelector > .bottomLeft {
    bottom: -4px;
    left: -4px;
}

#imageSelector > .topMiddle {
    top: -4px;
    left: 50%;
    margin-left: -2.5px; /* half of the width defined in #imageSelector > div */
}

#imageSelector > .rightMiddle {
    top: 50%;
    right: -4px;
    margin-top: -2.5px; /* half of the height defined in #imageSelector > div */
}

#imageSelector > .bottomMiddle {
    bottom: -4px;
    left: 50%;
    margin-left: -2.5px; /* half of the width defined in #imageSelector > div */
}

#imageSelector > .leftMiddle {
    top: 50%;
    left: -4px;
    margin-top: -2.5px; /* half of the height defined in #imageSelector > div */
}

div.webodf-customScrollbars::-webkit-scrollbar
{
    width: 8px;
    height: 8px;
    background-color: transparent;
}

div.webodf-customScrollbars::-webkit-scrollbar-track
{
    background-color: transparent;
}

div.webodf-customScrollbars::-webkit-scrollbar-thumb
{
    background-color: #444;
    border-radius: 4px;
}

.webodf-hyperlinkTooltip {
    display: none;
    color: white;
    background-color: black;
    border-radius: 5px;
    box-shadow: 2px 2px 5px gray;
    padding: 3px;
    position: absolute;
    max-width: 210px;
    text-align: left;
    word-break: break-all;
    z-index: 16;
}

.webodf-hyperlinkTooltipText {
    display: block;
    font-weight: bold;
}
